package com.chixing.ih.module.task.mapper;

import com.chixing.ih.common.IhRepository;
import com.chixing.ih.module.task.mapper.provider.AcceptTaskMapperProvider;
import com.chixing.ih.module.task.pojo.AcceptTask;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 目的:
 *
 * @author ：zcw
 * @version: 1.0  2020/9/25 20:03
 */
@Mapper
public interface AcceptTaskMapper {

    @SelectProvider(type = AcceptTaskMapperProvider.class, method = "getOne")
    @Results(id = "acceptTaskMap", value = {
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "send_task_user_id", property = "sendTaskUserId"),
            @Result(column = "receive_task_user_id", property = "receiveTaskUserId"),
            @Result(column = "create_time", property = "createTime"),
            @Result(column = "update_time", property = "updateTime"),
            @Result(column = "is_deleted", property = "logicalDeletion")
    })
    AcceptTask getOne(int id);

    @SelectProvider(type = AcceptTaskMapperProvider.class, method = "findAll")
    @ResultMap({"acceptTaskMap"})
    List<AcceptTask> listAll();


    @SelectProvider(type = AcceptTaskMapperProvider.class, method = "findCount")
    Long findCount(Long taskId);

    @UpdateProvider(type = AcceptTaskMapperProvider.class, method = "updateOne")
    Integer updateOne(AcceptTask acceptTask);

}
